// 封装商品信息接口

import { getDetail } from '@/apis/detail'
import { onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';

export function useGoodList(){
    const goods = ref({})
    const route = useRoute()
    const getGoodsList = async () =>{
        const res = await getDetail(route.params.id)
        goods.value = res.result
    }

    onMounted(async () => {
        await getGoodsList();
    });
    return{
        goods
    }
}